package com.dong.config;

import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * <h1></h1>
 *
 * @author : dzj
 * @create: 2019-10-30 22:18
 */
@EnableWebMvc
public class WegMvcConfig implements WebMvcConfigurer {
    @Override
    public void configureViewResolvers(ViewResolverRegistry registry) {
        registry.jsp("/WEB-INF/pages/",".html");
    }
    //注册拦截器
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        AccessInterceptor accessInterceptor = new AccessInterceptor();
        registry.addInterceptor(accessInterceptor).addPathPatterns("/usr/doLogin.do");
    }
    class AccessInterceptor implements HandlerInterceptor{
    }
}

